package com.gitee.wsl.doc.prosemirror.history.ext


import com.gitee.wsl.doc.prosemirror.history.bean.HistoryState
import com.gitee.wsl.doc.prosemirror.history.mapRanges
import com.gitee.wsl.doc.prosemirror.state.Transaction

fun HistoryState.add(
    tr: Transaction
) = HistoryState(
    done.addMaps(tr.mapping.maps),
    undone.addMaps(tr.mapping.maps),
    mapRanges(prevRanges, tr.mapping),
    prevTime,
    prevComposition
)